<?php
namespace common\components;

use Yii;
class ForbiddenHttpException extends \yii\web\ForbiddenHttpException{

    public function __construct($message = null, $code = 0, \Exception $previous = null){
        if(Yii::$app->user->getIsGuest()){
            $message = '游客，'.$message;
        }else{
            $message = Yii::$app->user->name.$message;
        }
        parent::__construct($message, $code, $previous);
    }

}